﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="vicePrinAddSubjectDetails.aspx.cs"
    Inherits="SMSSnew.UI.vicePrincipal.timetable.dataEntry.vicePrinAddSubjectDetails" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Add Subject Details</title>
    <link href="../../../../css/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="container">
        <form id="Form1" class="well span11 text-center" runat="server">
        <asp:HyperLink ID="HyperLink6" runat="server" CssClass="text-right"><h5>Logout</h5></asp:HyperLink>
        <h4 class="text-info">
            Add Subject Details</h4>
        <br />
        <table class="table container">
            <tr>
                <td class="Colwidth">
                    Subject Name:
                </td>
                <td>
                    <asp:TextBox ID="txtSubjectName" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txtSubjectName" Font-Size="Smaller">
                    Required Subject Name!</asp:RequiredFieldValidator>
                    <br />
                    <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="CustomValidator"
                        ControlToValidate="txtSubjectName" ClientValidationFunction="validateName" Font-Size="Smaller">
                    Letters of Subject Name should be more than 2 letters!</asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Subject Type Name:
                </td>
                <td>
                    <asp:TextBox ID="txtSubjectTypeName" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txtSubjectTypeName" Font-Size="Smaller">
                    Required Subject Type Name!</asp:RequiredFieldValidator>
                    <br />
                    <asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="CustomValidator"
                        ControlToValidate="txtSubjectName" ClientValidationFunction="validateName" Font-Size="Smaller">
                    Letters of Subject Type Name should be more than 2 letters!</asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Subject Code:
                </td>
                <td>
                    <asp:TextBox ID="txtSubjectCode" runat="server" MaxLength="3"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txtSubjectCode" Font-Size="Smaller">
                    Required Subject Code!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="RegularExpressionValidator"
                        ValidationExpression="[S]{1}[1-9]{1}[0-9]{0,1}$" ControlToValidate="txtSubjectCode"
                        Font-Size="Smaller">
                    Subject Code should be contained prefix 'S' and sufix 1 to 2 numbers only!</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Subject Type ID:
                </td>
                <td>
                    <asp:TextBox ID="txtSubjectTypeID" runat="server" MaxLength="4"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txtSubjectTypeID" Font-Size="Smaller">
                    Required Subject Type Code!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="RegularExpressionValidator"
                        ValidationExpression="[S]{1}[1-9]{1}[0-9]{1,2}$" ControlToValidate="txtSubjectTypeID"
                        Font-Size="Smaller">
                    Subject Code should be contained prefix 'S' and sufix 1 to 3 numbers only!</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Subject Weight:
                </td>
                <td>
                    <asp:TextBox ID="txtSubjectWeight" runat="server" MaxLength="1"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txtSubjectWeight" Font-Size="Smaller">
                    Required Subject Weight!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="RangeValidator"
                        MaximumValue="9" MinimumValue="1" ControlToValidate="txtSubjectWeight" Font-Size="Smaller">
                    Subject Weight should be 1-9</asp:RangeValidator>
                </td>
            </tr>
        </table>
        <table class="table container">
            <tr>
                <td class="Colwidth">
                    Total Slots:
                </td>
                <td class="tdWidth2">
                    <asp:Label ID="Label1" runat="server" Text="6" class="label"></asp:Label>
                </td>
                <td class="tdWidth2">
                    <asp:CheckBox ID="chckbx6" runat="server" OnChange="javascript:enableTextBox1();"
                        Checked="false" />
                </td>
                <td>
                    <asp:TextBox ID="txt6" runat="server" CssClass="span1" MaxLength="1" Enabled="false"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RFValid6" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txt6" Font-Size="Smaller" Enabled="False">
                     Required Subject Weight!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RangeValidator ID="RangeValidator2" runat="server" ErrorMessage="RangeValidator"
                        MaximumValue="6" MinimumValue="1" ControlToValidate="txt6" Font-Size="Smaller">
                    No of slots should be 1-6!</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="7" class="label"></asp:Label>
                </td>
                <td>
                    <asp:CheckBox ID="chckbx7" runat="server" OnChange="javascript:enableTextBox2();"
                        Checked="false" />
                </td>
                <td>
                    <asp:TextBox ID="txt7" runat="server" CssClass="span1" MaxLength="1" Enabled="false"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RFValid7" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txt7" Font-Size="Smaller">
                    Required Subject Weight!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RangeValidator ID="RangeValidator3" runat="server" ErrorMessage="RangeValidator"
                        MaximumValue="6" MinimumValue="1" ControlToValidate="txt7" Font-Size="Smaller">
                    No of slots should be 1-6!</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="8" class="label"></asp:Label>
                </td>
                <td>
                    <asp:CheckBox ID="chckbx8" runat="server" OnChange="javascript:enableTextBox3();"
                        Checked="false" />
                </td>
                <td>
                    <asp:TextBox ID="txt8" runat="server" CssClass="span1" MaxLength="1" Enabled="false"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RFValid8" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txt8" Font-Size="Smaller">
                    Required Subject Weight!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RangeValidator ID="RangeValidator4" runat="server" ErrorMessage="RangeValidator"
                        MaximumValue="6" MinimumValue="1" ControlToValidate="txt8" Font-Size="Smaller">
                    No of slots should be 1-6!</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label ID="Label4" runat="server" Text="9" class="label"></asp:Label>
                </td>
                <td>
                    <asp:CheckBox ID="chckbx9" runat="server" OnChange="javascript:enableTextBox4();"
                        Checked="false" />
                </td>
                <td>
                    <asp:TextBox ID="txt9" runat="server" CssClass="span1" MaxLength="1" Enabled="false"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RFValid9" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txt9" Font-Size="Smaller">
                    Required Subject Weight!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RangeValidator ID="RangeValidator5" runat="server" ErrorMessage="RangeValidator"
                        MaximumValue="6" MinimumValue="1" ControlToValidate="txt9" Font-Size="Smaller">
                    No of slots should be 1-6!</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label ID="Label5" runat="server" Text="10" class="label"></asp:Label>
                </td>
                <td>
                    <asp:CheckBox ID="chckbx10" runat="server" OnChange="javascript:enableTextBox5();"
                        Checked="false" />
                </td>
                <td>
                    <asp:TextBox ID="txt10" runat="server" CssClass="span1" MaxLength="1" Enabled="false"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RFValid10" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txt10" Font-Size="Smaller">
                    Required Subject Weight!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RangeValidator ID="RangeValidator6" runat="server" ErrorMessage="RangeValidator"
                        MaximumValue="6" MinimumValue="1" ControlToValidate="txt10" Font-Size="Smaller">
                    No of slots should be 1-6!</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label ID="Label6" runat="server" Text="11" class="label"></asp:Label>
                </td>
                <td>
                    <asp:CheckBox ID="chckbx11" runat="server" OnChange="javascript:enableTextBox6();"
                        Checked="false" />
                </td>
                <td>
                    <asp:TextBox ID="txt11" runat="server" CssClass="span1" MaxLength="1" Enabled="false"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RFValid11" runat="server" ErrorMessage="RequiredFieldValidator"
                        ControlToValidate="txt11" Font-Size="Smaller">
                    Required Subject Weight!</asp:RequiredFieldValidator>
                    <br />
                    <asp:RangeValidator ID="RangeValidator7" runat="server" ErrorMessage="RangeValidator"
                        MaximumValue="6" MinimumValue="1" ControlToValidate="txt11" Font-Size="Smaller">
                    No of slots should be 1-6!</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="btnAddSubjectDetails" runat="server" Text="ADD" CssClass="btn btn-success"
                        Font-Bold="True" />
                </td>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        </form>
    </div>
    <%--onclick="btnAddSubjectDetails_Click"--%>

    <script type="text/javascript">
        function validateName(sender, args) {
            if (args.Value.length < 3) {
                args.IsValid = false;
            }
        }

        function enableTextBox1() {
            var textBoxID = "<%= txt6.ClientID %>";
            if (document.getElementById("<%= chckbx6.ClientID %>").checked == true) {
                document.getElementById(textBoxID).disabled = false;
                ValidatorEnable(document.getElementById('<%=RFValid6.ClientID%>'), true);

            }
            else
                document.getElementById(textBoxID).disabled = true;
        }
        function enableTextBox2() {
            var textBoxID = "<%= txt7.ClientID %>";
            if (document.getElementById("<%= chckbx7.ClientID %>").checked == true) {
                document.getElementById(textBoxID).disabled = false;
                ValidatorEnable(document.getElementById('<%=RFValid7.ClientID%>'), true);
            }
            else
                document.getElementById(textBoxID).disabled = true;
        }
        function enableTextBox3() {
            var textBoxID = "<%= txt8.ClientID %>";
            if (document.getElementById("<%= chckbx8.ClientID %>").checked == true) {
                document.getElementById(textBoxID).disabled = false;
                ValidatorEnable(document.getElementById('<%=RFValid8.ClientID%>'), true);
            }
            else
                document.getElementById(textBoxID).disabled = true;
        }
        function enableTextBox4() {
            var textBoxID = "<%= txt9.ClientID %>";
            if (document.getElementById("<%= chckbx9.ClientID %>").checked == true) {
                document.getElementById(textBoxID).disabled = false;
                ValidatorEnable(document.getElementById('<%=RFValid9.ClientID%>'), true);
            }
            else
                document.getElementById(textBoxID).disabled = true;
        }
        function enableTextBox5() {
            var textBoxID = "<%= txt10.ClientID %>";
            if (document.getElementById("<%= chckbx10.ClientID %>").checked == true) {
                document.getElementById(textBoxID).disabled = false;
                ValidatorEnable(document.getElementById('<%=RFValid10.ClientID%>'), true);
            }
            else
                document.getElementById(textBoxID).disabled = true;
        }
        function enableTextBox6() {
            var textBoxID = "<%= txt11.ClientID %>";
            if (document.getElementById("<%= chckbx11.ClientID %>").checked == true) {
                document.getElementById(textBoxID).disabled = false;
                ValidatorEnable(document.getElementById('<%=RFValid11.ClientID%>'), true);
            }
            else
                document.getElementById(textBoxID).disabled = true;
        }
    </script>

</body>
</html>
